//
//  BCNewOrderDetailInfoCollectionViewCell.m
//  BangcaiSale
//
//  Created by Liang Zhang on 16/7/9.
//  Copyright © 2016年 Bangcai. All rights reserved.
//

#import "BCNewOrderDetailInfoCollectionViewCell.h"

@implementation BCNewOrderDetailInfoCollectionViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    self.invoiceButton.layer.borderColor = [UIColor colorWithRed:0.969 green:0.706 blue:0.357 alpha:1.000].CGColor;
    self.invoiceButton.layer.borderWidth = 2.f;
    self.invoiceButton.layer.cornerRadius = self.invoiceButton.frame.size.height/2;
    
    //临时数据 市场均价：￥14000.00
    NSString *market_price = @"￥14000.00";
    
    NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:self.priceLable.text];
    UIColor *textColor_red = [UIColor colorWithRed:0.255 green:0.518 blue:0.984 alpha:1.000];
    NSString *titleString = @"市场均价：";
    [attributedString addAttribute:NSForegroundColorAttributeName  //文字颜色
                                      value:[UIColor darkGrayColor]
                                      range:NSMakeRange(0, titleString.length)];
    [attributedString addAttribute:NSForegroundColorAttributeName  //文字颜色
                                      value:textColor_red
                                      range:NSMakeRange(titleString.length, market_price.length)];
    self.priceLable.attributedText = attributedString;
}

+ (instancetype)cellWithCollectionView:(UICollectionView *)collectionView {
    static NSString *ID = @"NewOrderDetailInfoCellIdentifer";
    UINib *nib = [UINib nibWithNibName:@"BCNewOrderDetailInfoCollectionViewCell" bundle: [NSBundle mainBundle]];
    [collectionView registerNib:nib forCellWithReuseIdentifier:ID];
    BCNewOrderDetailInfoCollectionViewCell *cell = [[BCNewOrderDetailInfoCollectionViewCell alloc] init];
    return cell;
}

@end
